package com.caocaog.market.finance.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.caocaog.market.finance.entity.FinanceLine;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FinanceLineMapper extends BaseMapper<FinanceLine> {

    IPage<FinanceLine> queryFinanceLinePage(Page<FinanceLine> page,
                                            @Param(Constants.WRAPPER) Wrapper<FinanceLine> queryWrapper,
                                            @Param("siteId") String siteId,
                                            @Param("merchantId") String merchantId,
                                            @Param("shopId") String shopId,
                                            @Param("orderNo") String orderNo,
                                            @Param("groupNo") String groupNo,
                                            @Param("siteName") String siteName);

    Integer updateFinanceLineStatus(@Param("ids") List<Long> ids, @Param("type") Integer type, @Param("status") Integer status);

    Integer selectFinanceLineUnWithdrawCount(@Param("ids") List<Long> ids,
                                             @Param("type") Integer type,
                                             @Param("pendingWithdrawal") Integer pendingWithdrawalStatus);

    List<FinanceLine> findNeedSettlement(@Param("settlementTime") String settlementTime,
                                         @Param("orderCompletionStatus") Integer orderCompletionStatus);

    List<String> getFinanceLineShopIds(@Param("ids") List<Long> ids);

}
